import { defineStore } from 'pinia';

export const useStore = defineStore('main', {
    // 开启数据持久化
    persist: true,
    state: () => {
        return {
            isOpen: false,
            pageTabs: [
                {
                    path: '/home-page',
                    title: '首页'
                }
            ],
            userInfo: {}, //用户信息
            projectInfo: {} //项目信息
        };
    },
    actions: {
        setIsOpen(val) {
            this.isOpen = val;
        },
        setUserInfo(val) {
            this.userInfo = val;
        },
        setProjectInfo(val) {
            this.projectInfo = val;
        },
        setPageTabs(val) {
            this.pageTabs = val;
        }
    }
});
